/**
 * @Title: ProxyAuthenticator.java
 * @Package com.sunbeam.common.utils.proxy
 * @Description: TODO
 * @author lyz lyzpoq_gmail_com
 * @date 2013/09/27 16:53:23
 * @version V1.0
 */

package com.sunbeam.common.utils.proxy;

import java.net.Authenticator;
import java.net.PasswordAuthentication;

import com.sunbeam.common.utils.encrypt.EncryptUtils;

/**
 * @ClassName: ProxyAuthenticator
 * @Description: TODO
 * @author lyz lyzpoq_gmail_com
 * @date 2013/09/27 16:53:23
 */

public class ProxyAuthenticator extends Authenticator {
	private String userName, password;

    @Override
	protected PasswordAuthentication getPasswordAuthentication() {
        return new PasswordAuthentication(userName, password.toCharArray());
    }

    public ProxyAuthenticator(String userName, String password) {
        this.userName = EncryptUtils.decrypt2StringByDES(userName);
        this.password = EncryptUtils.decrypt2StringByDES(password);
    }
	
}

